package function

import com.sun.deploy.panel.ITreeNode

import scala.beans.BeanProperty
import scala.collection.mutable.{ArrayBuffer, ListBuffer}

object ArrayBuffer01 {
  def main(args: Array[String]): Unit = {
    val typeValue = new Type("张三", 18, "🚹")
    val types = new ArrayBuffer[Int]()
    types.append(12, 3, 4, 4, 5, 5, 6, 6)
    println(types.mkString("-"))
    //   types.append(("李四",13,"女"))
    println(typeValue.getClass.getSimpleName)
    //二维数组
    val array: Array[Array[Int]] = Array.ofDim[Int](2, 3)
    array(0)(0) = 1
    array(0)(1) = 2
    array(0)(2) = 3
    array(1)(0) = 1
    println(array.mkString(","))
    //展示二维数组
    for (i <- 0 until array.length; j <- 0 until array(i).length) {
      print(array(i)(j) + "\t")
      if (j == array(i).length - 1) println()
    }
    val list = List("df", 34.45)
    val list1: List[Any] = list.+:(2)::"😁"::Nil
    println(list1)
    println(list1.getClass.getSimpleName)
    println(list:::list1)
    println(list++list1)
    val buffer: ListBuffer[Any] = ListBuffer(12, 34, "嘎嘎", 'd')
    val buffer1: ListBuffer[Any] = ListBuffer(56, 7, "民族")
    println(buffer++=:buffer1)
    println("===============")
    println(buffer++buffer1)
    println(buffer+:buffer1::Nil)

  }

}

class Type  {
  @BeanProperty
  var name: String = _
  @BeanProperty
  var age: Int = _
  @BeanProperty
  var sex: String = _

  def this(name: String, age: Int, sex: String) { //辅助构造方法
    this() //主辅助构造方法
    this.name = name
    this.age = age
    this.age = age
    println(s"name:${name},age:${age},sex${sex}")
  }

}
